4 examples for git diff
# Show the changed filenames between HEAD and origin/develop.
git diff --stat origin/develop
# This is useful for sharing/saving a set of changes
# without having to commit anything.
# Create a patch file containing a diff.
git diff > diff.patch
# Apply the changes within the patch.
git apply diff.patch
# Show the differences between your working directory and the index
git diff
#
# Show the differences between most recent commit and the index
git diff --cached
# Show the differences between the working directory and the most recent commit
git diff HEAD
# Compare the file foo.py in HEAD to the same file in origin/develop.
git diff HEAD origin/develop foo.py